package com.manage.controller;

import com.clms.common.R;
import com.manage.pojo.entity.TbClient;
import com.manage.pojo.entity.TbMemberLevel;
import com.manage.pojo.vo.ClientVo;
import com.manage.pojo.vo.VipLevelVo;
import com.manage.service.VipLevelService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @program: clms-third
 * @description: 会员等级控制层
 * @author: 林子洁
 * @create: 2021-07-23 14:42
 **/
@RestController
@RequestMapping("/manage/level")
public class VipLevelController {
    @Resource
    private VipLevelService levelService;
    @PostMapping("/initVipLevel/{currentPage}/{pageSize}")
    public R initVipLevel(@PathVariable("currentPage") Integer currentPage,
                          @PathVariable("pageSize") Integer pageSize,
                        @RequestBody VipLevelVo vipLevelVo){
        return levelService.initVipLevel(currentPage,pageSize,vipLevelVo);
    }
    @PostMapping("/insertLevel")
    public R insertlevel(@RequestBody TbMemberLevel memberLevel){
        return levelService.insertLevel(memberLevel);
    }
    @PutMapping("/updateLevel")
    public R Updatelevel(@RequestBody TbMemberLevel memberLevel){
        return levelService.updateLevel(memberLevel);
    }
    @DeleteMapping("/deleteVipLevel/{id}")
    public R deleteVipLevel(@PathVariable("id") Integer id){
        return levelService.deleteVipLevel(id);
    }
    @PostMapping("/selectByVipId/{id}")
    public R selectByVipId(@PathVariable("id") Integer id){
        return levelService.selectByVipId(id);
    }

}
